package com.sinosoft.hydra.um.domain.permission;

import com.alibaba.fastjson.annotation.JSONField;
import cn.com.sinux.spring.commons.TreeNode;
import com.sinosoft.hydra.um.domain.model.DirectoryType;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "T_DIRECTORY")
public class TDirectory implements TreeNode<TDirectory>, Serializable {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column T_DIRECTORY.ID
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @Column(name = "ID")
    private String id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column T_DIRECTORY.DIR_CODE
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    @NotNull(message = "tdirectory.dircode.not.null")
    @Column(name = "DIR_CODE")
    private String dirCode;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column T_DIRECTORY.DIR_VALUE
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    @NotNull(message = "tdirectory.dirvalue.not.null")
    @Column(name = "DIR_VALUE")
    private String dirValue;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column T_DIRECTORY.DIR_DESCRIPTION
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    @Column(name = "DIR_DESCRIPTION")
    private String dirDescription;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column T_DIRECTORY.DIR_GROUP
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    @NotNull(message = "tdirectory.dirgroup.not.null")
    @Column(name = "DIR_GROUP")
    private String dirGroup;


    @Column(name = "DIR_CONFIG")
    private String dirConfig;



    @Column(name = "DIR_CONFIG1")
    private String dirConfig1;
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column T_DIRECTORY.DIR_ORDER
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    @Column(name = "DIR_ORDER")
    private Integer dirOrder;

    @Column(name = "DISPLAY")
    private Integer display;

    public Integer getDirOrder() {
        return dirOrder;
    }

    public void setDirOrder(Integer dirOrder) {
        this.dirOrder = dirOrder;
    }

    @Transient
    private List<TDirectory> children;
    @Transient
    private DirectoryType directoryType;

    public Integer getDisplay() {
        return display;
    }

    public void setDisplay(Integer display) {
        this.display = display;
    }


    public List<? extends TreeNode> getChildren() {
        return children;
    }


    public void setChildren(List<TDirectory> children) {
        this.children = children;
    }

    public DirectoryType getDirectoryType() {
        return directoryType;
    }

    public void setDirectoryType(DirectoryType directoryType) {
        this.directoryType = directoryType;
    }

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table T_DIRECTORY
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    private static final long serialVersionUID = 1L;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column T_DIRECTORY.ID
     *
     * @return the value of T_DIRECTORY.ID
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public String getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column T_DIRECTORY.ID
     *
     * @param id the value for T_DIRECTORY.ID
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column T_DIRECTORY.DIR_CODE
     *
     * @return the value of T_DIRECTORY.DIR_CODE
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public String getDirCode() {
        return dirCode;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column T_DIRECTORY.DIR_CODE
     *
     * @param dirCode the value for T_DIRECTORY.DIR_CODE
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public void setDirCode(String dirCode) {
        this.dirCode = dirCode;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column T_DIRECTORY.DIR_VALUE
     *
     * @return the value of T_DIRECTORY.DIR_VALUE
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public String getDirValue() {
        return dirValue;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column T_DIRECTORY.DIR_VALUE
     *
     * @param dirValue the value for T_DIRECTORY.DIR_VALUE
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public void setDirValue(String dirValue) {
        this.dirValue = dirValue;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column T_DIRECTORY.DIR_DESCRIPTION
     *
     * @return the value of T_DIRECTORY.DIR_DESCRIPTION
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public String getDirDescription() {
        return dirDescription;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column T_DIRECTORY.DIR_DESCRIPTION
     *
     * @param dirDescription the value for T_DIRECTORY.DIR_DESCRIPTION
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public void setDirDescription(String dirDescription) {
        this.dirDescription = dirDescription;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column T_DIRECTORY.DIR_GROUP
     *
     * @return the value of T_DIRECTORY.DIR_GROUP
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public String getDirGroup() {
        return dirGroup;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column T_DIRECTORY.DIR_GROUP
     *
     * @param dirGroup the value for T_DIRECTORY.DIR_GROUP
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */
    public void setDirGroup(String dirGroup) {
        this.dirGroup = dirGroup;
    }

    public String getDirConfig() {
        return dirConfig;
    }

    public void setDirConfig(String dirConfig) {
        this.dirConfig = dirConfig;
    }

    public String getDirConfig1() {
        return dirConfig1;
    }

    public void setDirConfig1(String dirConfig1) {
        this.dirConfig1 = dirConfig1;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table T_DIRECTORY
     *
     * @mbggenerated Tue Sep 08 12:54:44 CST 2015
     */

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", dirCode=").append(dirCode);
        sb.append(", dirValue=").append(dirValue);
        sb.append(", dirDescription=").append(dirDescription);
        sb.append(", dirGroup=").append(dirGroup);
        sb.append("]");
        return sb.toString();
    }
}